

#ifndef SMTPSessionManager_H_
#define SMTPSessionManager_H_

#include "Message.h"

#include <string>
#include <memory>
#include <vector>



typedef std::unique_ptr<Message> MsgPtr;

namespace SMTP{


class SMTPSessionManager {
private:

  enum STATE { GREET, EHLO, MAIL, RCPT, DATA, BODY, QUIT};

  unsigned long m_msgCount;
  STATE _currState;

  std::vector<MsgPtr> _msgColl;

  MsgPtr              _activeMsg;

  bool processMailFrom(const std::string& data);

  bool processRcptTo(const std::string& data);

public:
  SMTPSessionManager();
  std::string greetMessage();
  std::string processCommand(const std::string& data);

  int getMsgCount() {return _msgColl.size(); }
};

}
#endif //SMTPSessionManager_H_
